package com.java.test.concurrent;

import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;

public class ConcurrentSkipListMapDemo2 {

    private static ConcurrentSkipListMap<Integer, String> map =
            new ConcurrentSkipListMap<Integer, String>();

    public static void main(String[] args) {

        map.put(1, "A");
        map.put(2, "B");
        map.put(3, "C");

        map.put(7, "G");
        map.put(8, "H");
        map.put(9, "I");

        map.put(4, "D");
        map.put(5, "E");
        map.put(6, "F");


        ConcurrentNavigableMap<Integer, String> sub1 = map.subMap(1, 4);
        System.out.println(sub1);

        ConcurrentNavigableMap<Integer, String> sub2 = map.subMap(4, 7);
        System.out.println(sub2);
        
        ConcurrentNavigableMap<Integer, String> sub3 = map.subMap(7, 11);
        System.out.println(sub3);
    }


}
